package top.wilbert.collegelink.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import top.wilbert.collegelink.user.dao.CompanyDao;
import top.wilbert.collegelink.user.entity.CompanyEntity;
import top.wilbert.collegelink.user.service.CompanyService;
import top.wilbert.collegelink.common.utils.PageUtils;
import top.wilbert.collegelink.common.utils.Query;

import java.util.List;
import java.util.Map;


@Service("companyService")
public class CompanyServiceImpl extends ServiceImpl<CompanyDao, CompanyEntity> implements CompanyService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<CompanyEntity> page = this.page(
                new Query<CompanyEntity>().getPage(params),
                new QueryWrapper<CompanyEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<CompanyEntity> okList() {

        List<CompanyEntity> companyEntities = baseMapper.selectList(new QueryWrapper<CompanyEntity>().eq("certification_status", 2));
        return companyEntities;
    }


}